haForm Heap Alert 1.1 wwwwwwwp wwwwwwwwwwwp Form1, Label5 Label3 Used: Label8 Free: Label1 User: userCount userBytes userPercent Label2 gdiCount gdiBytes gdiPercent Label12 Fonts: fontCount sampleTimer Label13 Bitmaps: bitmapCount Label14 dcCount Label16 Brushes: brushCount autoSample &Auto Label17 Regions: regionCount Label19 Palettes: paletteCount getInfo &Sample Label15 Pens: penCount Label6 Other: otherCount Label18 Metafiles: metafileCount Label4 MetaDCs: metaDCCount Label7 DisDCs: disabledDCCount getInfo_Click sUSERINFOh sGDIINFO sUSERHEAPINFOF sGDIHEAPINFO UserHeapInfo! GDIHeapInfoq userPercent caption wPercentFreeT gdiPercentS dwSize5 sizeUSERHEAPINFO sizeGDIHEAPINFO userFreev wHeapFree gdiFreeo LocalFirst sLOCALENTRY hSegment LocalNext| wType iFonts iBitmapsQ iPens$ iBrushes5 iRegionsc iMetafiles iPalettesQ LT_GDI_FONT LT_GDI_| LT_GDI_BITMAP: LT_GDI_DCq LT_GDI_PEN! LT_GDI_BRUSH LT_GDI_REGION LT_GDI_RGN LT_GDI_METAFILE LT_GDI_PALETTE( fontCount bitmapCount- dcCount penCount0 brushCount3 regionCountw metafileCount paletteCount sizeLOCALENTRY: makeLong iGDICounth gdiCount userCount iUSERCount` autoSample_Click autoSample value sampleTimer enabled retrieveData sampleTimer_Timer lewTypeo Form_Click @ Form_Load5 haForm mousePointer screenu GlobalFirst GLOBAL_ALL hOwner GT_CODEq codeCount codeBytes dwBlockSize GT_DGROUP+ wHeapPresent LocalInfo hBlock wHeapTypeI GDI_HEAP wFlags LF_FREE wSize localHeap localHeapBytes hTask taskMemL taskAllocs GlobalNext sGLOBALENTRY sLOCALINFO Elsif USER_HEAP dgiBytes userBytes gdiBytes{ andIf" iNumGDIHeaps iNumUserHeapsK LT_GDI_METADC iMetaDC LT_DISABLED_DC iDisabledDC metaDCCount iMetaDCCount disabledDCCount iDisabledDCCount LT_GDI_DISABLED_DC iOther LT_OTHER otherCount LT_NORMALl sSYSTEMHEAPINFO SystemHeapInfoE sSYSHEAPINFO wUserFreePercent wGDIFreePercent8 hGDISegment hUserSegment iUserHeap& iGDIHeap Form_Unload Cancel Version GetVersion! LT_PEN check WindowsVersion/ Major Minor brushCount_Click disabledDCCount_Click metaDCCount_Click getInfo_Click makeLong Visual Basic needs unsigned integers! autoSample_Click retrieveData initialize the sizes of these structures find the User and GDI heaps, but only the first time in 3.0 the heaps are 1 greater than sh.hX in 3.1 the heaps are 1 less than sh.hX. walk the User heapG walk the GDI heap for some reason, 3.1 counts metafiles as "other"A not sure why these numbers don't come out the same. according to the documentation they should. userPercent.caption = LTrim$(Str$(100-CInt(100 * CSng(ub&) / 65536!))) + "%" gdiPercent.caption = LTrim$(Str$(100-CInt(100 * CSng(gb&) / 65536!))) + "%"" sampleTimer_Timer Form_Load Heap Alert 1.1 Requires at least Windows 3.1 commercial.